import request from '@/utils/request/req';

// 企业切换大模型接口参数
export interface SwitchModelParams {
  modeManufacturer?: string;
  modeName?: string;
  accountType?: string;
}

// 企业切换大模型返回数据
export interface SwitchModelListData {
  records: Array<{
    id: number;
    modeManufacturer: string;
    modeName: string;
    aiChat: boolean;
    aiFriendCircleLikes: boolean;
    computingPowerPrice: string;
    tokenInputPrice: string;
    tokenOutputToken: string;
    accountType: string;
  }>;
  total: number;
  size: number;
  current: number;
}

export interface SwitchModelResponse {
  code: number;
  msg: string;
  data: SwitchModelListData;
  rows: [];
}

// 修改企业切换大模型请求参数
export interface UpdateSwitchModelParams {
  id: number;
  accountType: string;
  aiChat: string;
  aiFriendCircleLikes: string;
}

// 修改企业切换大模型返回数据
export interface UpdateSwitchModelResponse {
  code: number;
  msg: string;
  data: null;
}

// 查询企业切换大模型列表
export function getSwitchModelList(params: SwitchModelParams) {
  return request.get<SwitchModelResponse>('/msg/manufacturer/list', { params });
}

// 修改企业切换大模型
export function updateSwitchModel(data: UpdateSwitchModelParams) {
  return request.post<UpdateSwitchModelResponse>('/msg/switch', data);
}
